package bb.lanxing.activity.mine;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

import bb.lanxing.R;
import bb.lanxing.activity.base.BaseActivity;
import bb.lanxing.adapter.mine.EditCourseAdapter;

public class EditCourseActivity extends BaseActivity {
    private RecyclerView mRecyclerView;
    private EditCourseAdapter mAdapter = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_course);

        ImageView back = findViewById(R.id.back);
        back.setOnClickListener(v -> onBackPressed());

        mRecyclerView = findViewById(R.id.recyclerView);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        List<String> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("3");
        mAdapter = new EditCourseAdapter(list);
        mAdapter.setOnItemClickListener(position -> {
            Intent intent = new Intent(this, EditCourseDetailActivity.class);
            intent.putExtra("sportMode", position);
            intent.putExtra("title", list.get(position));
            startActivity(intent);
        });
        mRecyclerView.setAdapter(mAdapter);
    }
}